package com.wanlian.dao;

import com.wanlian.common.PageCondition;
import com.wanlian.entity.Card;
import com.wanlian.model.ResultModel;
import com.wanlian.vo.Page;

import java.util.List;

public interface CardDao extends GenericDao<Card> {

    ResultModel queryCard(PageCondition pageCondition);

    ResultModel queryCardByUser(Page page, int userId);

    /**
     * 通过code查询卡片
     *
     * @param code
     * @return
     */
    Card queryByCode(String code);

    /**
     * 通过商品Id
     *
     * @param id
     * @return
     */
    Card queryCardByProductId(int id);

    long queryCardChanggeTimeById(int userId);

    List<Card> queryCardsNoUsed(int id);

    void doEditBatch(List<Card> cards);
}
